package com.example.easyscript.utils.recognization;

import com.example.easyscript.utils.recognization.surfpro.ConsoleView;
import com.example.easyscript.utils.recognization.surfpro.FeatureMatching;
import org.opencv.core.Core;

public class RecognizationSURFPro {
    public static Boolean judgeTemplateIsInSource(String templatePath, String sourcePath, float confidence, Integer passCount) {
        System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
        FeatureMatching mather = new FeatureMatching(new ConsoleView());
        mather.setSource(sourcePath);
        Integer ans = mather.doMaping(templatePath);
        System.out.println(("通过阈值:"+ passCount +" 当前特征点: "+ ans+"个") + (ans>=passCount ? " 通过":"不通过"));
        return ans >= passCount;
    }
}
